package one.three.twentyOne;

import java.awt.event.ItemEvent;

public class Find {

	private static class Node<Item> {
		private Item item;
		private Node next;

		public boolean find(Item key) {
			Node<Item> c = this;
			while (c != null) {
				if (c.item.equals(key))
					return true;
				c = c.next;
			}
			return false;
		}

	}

	public static void main(String[] args) {
		Node<String> f = new Node<String>();
		f.item = "0";
		Node<String> c = f;
		for (int i = 1; i <= 10; i++) {
			c.next = new Node<String>();
			c.next.item = i + "";
			c = c.next;
		}
		c = f;
		while (c != null) {
			System.out.println(c.item);
			c = c.next;
		}
		System.out.println(f.find("11"));
	}

}
